﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaxLengthDemo.aspx.cs"
    Inherits="WebAppDemo.NetPage.MaxLengthDemo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

    <%--<script src="../Scripts/jquery-2.0.1.js" type="text/javascript"></script>--%>

    <script src="../Scripts/jquery.1.2.6.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.maxlength.js" type="text/javascript"></script>

    <script type="text/javascript">
	    jQuery(document).ready(function($) {
		    //Set maxlength of all the textarea (call plugin)
		    $().maxlength();
	    });
//	    function checkLength(txt,len) {
//		    if (txt.value.length>=len) {
//			    return false;
//		    }
//		    return true;
//	    }

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        MultiLine:<br />
        <ul>
            Validator:
            <asp:TextBox ID="txtValidator" MaxLength="10" runat="server" TextMode="MultiLine"
                Rows="3" />
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="RegularExpressionValidator"
                ControlToValidate="txtValidator" SetFocusOnError="True" ValidationExpression="^[a-zA-Z.]{0,10}$"></asp:RegularExpressionValidator>
        </ul>
        <ul>
            javascript:
          <%--  <asp:TextBox ID="TextBox2" onkeypress="return checkLength(this,10);" TextMode="multiLine"
                runat="server"> </asp:TextBox>--%>
        </ul>
        <ul>
            jQuery:
            <asp:TextBox ID="TextBox1" maxlength="10" TextMode="multiLine" runat="server"> </asp:TextBox>
            
            
            
        </ul>
    </div>
    </form>
</body>
</html>
